export function isPWA() {
  const displayModes = ['fullscreen', 'standalone', 'minimal-ui']
  const matchesPwa = displayModes.some(
    (displayMode) =>
      window.matchMedia('(display-mode: ' + displayMode + ')').matches
  )

  return (
    matchesPwa ||
    window.navigator?.standalone ||
    document.referrer.includes('android-app://')
  )
}
